package com.handinfo.android.core.ui;

import android.content.Context;
import android.view.View;
import android.widget.ToggleButton;

public class UIToggleButton extends UIButton
{
	public boolean m_checked;

	public UIToggleButton(Context context)
	{
		super(context);

	}

	//设置开关按钮
	public void setToggleButton(View view, boolean checked, String str1, String str2, int color1, int color2)
	{
		ToggleButton tb = (ToggleButton) view;
		//是否打开
		tb.setChecked(checked);
		//设置打开和关闭的文字
		//设置背景颜色
		if (checked == true) {
			tb.setText(str1);
			tb.setBackgroundColor(color1);
		}
		if (checked == false) {
			tb.setText(str2);
			tb.setBackgroundColor(color2);

		}
	}

}
